// pages/mine/MyVehicle/ImproveVehicle/ImproveVehicle.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    date:'',//购车时间
    carNum:'',//车牌号
    VIN:'',
    userName:'',//车主姓名
    phone:'',//手机号
    IdNumber:'',//身份证号
    ajxtrue: false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      console.log(options.carId)
      if(options.carId){
        this.setData({
          ajxtrue:true
        })
      }else{
        this.setData({
          ajxtrue:false
        })
      }
      
  },
  bindDateChange: function(e) {
    this.setData({
      date: e.detail.value
    })
  },
  //手机号验证
  getPhone(e){
    var phone = e.detail.value;
    let that = this
    if (!(/^1[34578]\d{9}$/.test(phone))) {
      this.setData({
        phone: phone
      })
    } 
    if (phone.length < 11) {
      wx.showToast({
        title: '手机号有误',
        icon: 'success',
        duration: 2000
      })
      this.setData({
        phone: ''
      })
    }
  },
  //行驶证
  goPictuer(e){
    console.log(e.currentTarget.dataset.index)
    wx.navigateTo({
      url: '/pages/mine/MyVehicle/UploadCertifly/UploadCertifly?id='+e.currentTarget.dataset.index,
    })
  },
  backVehicle(){
    
  }
  

})